from datetime import timedelta


class Config:
    SECRET_KEY = 'hard to guess string'
    JWT_SECRET_KEY = "super-secret"
    JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=1)  # 设置普通JWT过期时间
    JWT_REFRESH_TOKEN_EXPIRES = timedelta(days=30)  # 设置刷新JWT过期时间

    @staticmethod
    def init_app(app):
        pass


class DevelopmentConfig(Config):
    DEBUG = True
    HOSTNAME = "127.0.0.1"
    PORT = 3306
    USERNAME = "root"
    PASSWORD = "123456"
    DATABASE = "software"
    SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}/{DATABASE}?charset=utf8mb4"
    ALIBABA_CLOUD_ACCESS_KEY_ID = 'LTAI5tQ5RAJ8MeKVGcMtB2m5'
    ALIBABA_CLOUD_ACCESS_KEY_SECRET = 'xXxNfgT8s3kl9W4DfeYRtXYm7Y5JwY'


config = {
    'development': DevelopmentConfig,
    'default': DevelopmentConfig,
}
